package com.yaoli.ajob;

/**
 * Created by will on 2017/7/8.
 */
public class _633_SumofSquareNumbers {
    public boolean judgeSquareSum(int c) {
        if(c == 0){
            return true;
        }
        int res = (int)Math.sqrt(c);

        for(int i = 1 ; i <= res ; i ++){
            int left = (int) Math.sqrt(c - i*i);
            if(left*left + i*i == c){
                return true;
            }
        }
        return false;
    }
}
